<?php

namespace App\Http\Controllers\admin;

use App\Dao\ProjectDao;
use App\Http\Controllers\user\BaseController;
use App\Services\Code;

class ProjectPassController extends BaseController
{

    public function lists(){
        if(isPost()){
            $params = request()->all();
            ProjectDao::add_project_pass_value($params);
            return  Code::message('添加成功');
        }

        if(getIsHasPage()){
            return  Code::message('',200,ProjectDao::get_project_pass_page());
        }

        return view('admin.project_pass.lists',[
            'projects'=>ProjectDao::get_projects()
        ]);
    }


    public function del_pass(): array
    {
        ProjectDao::del_project_pass(request()->all());
        return Code::message('删除成功',200);
    }
}
